#!usr/bin/perl -w

die "usage:perl $0 <all_orthomcl.out> <remove ID> \n" unless @ARGV == 2;

open A,$ARGV[0];
my $mark=0;
while(<A>){
	chomp; my @a=split /\s+/; my $rec1=0;	my $rec2=0;	my @b=split /\s+/,$a[1];	my @last;
	foreach my $k1(3..$#a){
		if($a[$k1]=~/$ARGV[1]/){
			$rec1++;	$rec2=1;
		}
		else{
			push @last,$a[$k1];
		}	
	}
	my $inf=join " ",@last;	
	my @c=split /\(/,$a[0];	my @d=split /,/,$a[1];
	my $l1=$c[1]-$rec1;	my $l2=$d[1]-$rec2;
	next if($l1 == 0);	 next if($l2 == 0);
	print "ORTHOMCL$mark($l1 genes,$l2 taxa):\t $inf\n";
	$mark++;
}
close A;
